package vn.axonivy.vision.streams;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class Collecting {
	public static void main(String[] args) {
		/*
		 * collect() method used to recieve elements from a sream and store them
		 * in a collection and metioned in parameter funcion.
		 */
		List<String> memberNames = new ArrayList<>();
		memberNames.add("Amitabh");
		memberNames.add("Shekhar");
		memberNames.add("Aman");
		memberNames.add("Rahul");
		memberNames.add("Shahrukh");
		memberNames.add("Salman");
		memberNames.add("Yana");
		memberNames.add("Lokesh");

		List<String> memNamesInUppercase = memberNames.stream().sorted()
				.map(String::toUpperCase).collect(Collectors.toList());

		System.out.print(memNamesInUppercase);
	}
}
